Fragment Patcher
class FragmentPatcher(defaultExtension: String, fragmentAnalyzer: FragmentAnalyzer = RegexFragmentAnalyzer(), logger: AbstractLogger)
This class will return a String containing fragment definitions. This String can then be appended to a GraphQL operation in order to have all referenced fragments fully defined, before sending it to the server. This allows a GraphQL operation to reference fragments, but have the definition of those fragments live outside of the file that the operation lives in.
This class also properly handles recursion. This means fragments can have references to other fragments, and it will do its best to resolve everything correctly.
Author
eschlenz
Constructors
Link copied to clipboard
constructor(defaultExtension: String, fragmentAnalyzer: FragmentAnalyzer = RegexFragmentAnalyzer(), logger: AbstractLogger)
Functions
Link copied to clipboard
fun includeMissingFragments(graphFile: String, graphContent: String, availableGraphFiles: Map<String, String>, aggregation: StringBuilder = StringBuilder()): String